#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main() {
    int a, b, count = 0;
    scanf("%d %d", &a, &b);
    for (int i = a; i <= b; i++)
    {
        int sum = 0;
        int k = i;
        while (k)
        {
            sum += k % 10;
            k /= 10;
        }
        if (sum % 5 == 0)
        {
            count++;
        }
    }
    printf("%d", count);
    return 0;
}